feat(contributions): first-1k founding contributor award#3972
Merged
Conversation
Grant a founding-contributor award to the first 1000 contributors. - ContributionFoundingContributor entity + migration (idempotency marker + cap counter) - grantFoundingContributorAward: system-sender Product award via transferCores, Cores value paid to the receiver; transactional, idempotent per user, best-effort cap - Award product id comes from the CONTRIBUTION_FOUNDING_AWARD_PRODUCT_ID env var (no-op until set) - Worker fires on the approved-submission event
|
🍹 The Update (preview) for dailydotdev/api/prod (at cae4fb0) was successful. Resource Changes Name Type Operation
~ vpc-native-rotate-weekly-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-monthly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-tag-materialized-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-old-notifications-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-lifecycle-state-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-channel-highlights-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-456bb00c kubernetes:batch/v1:Job delete
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
+ api-sub-api.contribution-action-completed-founding gcp:pubsub/subscription:Subscription create
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-channel-highlights-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-daily-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-yearly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-achievement-rarity-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-post-analytics-achievements-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-d178395e kubernetes:batch/v1:Job create
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-456bb00c kubernetes:batch/v1:Job delete
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
... and 16 other changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grants a founding-contributor award to the first 1000 contributors, live as they earn their first approved submission.
What's included
ContributionFoundingContributorentity (userIdPK) + migration — doubles as the idempotency marker and the cap counter.grantFoundingContributorAward— reserves a founding slot under the cap, then issues the award as a system-paid Product award: aUserTransactionwithsenderId = systemUser.id+transferCores, so the receiver gets the award's Cores value (mirrorsfulfillContributionCoresReward). The whole grant is transactional, so a failed Cores transfer rolls back the reservation and retries cleanly.ON CONFLICT DO NOTHING, checked throughRETURNING—identifiersis unreliable for a provided PK). Cap is best-effort under concurrency, matching the existing referral-award approach.api.v1.contribution-action-completed(same low-frequency approved-submission event as milestones).CONTRIBUTION_FOUNDING_AWARD_PRODUCT_IDenv var; the grant is a no-op until it's set, so this can ship before the dedicated product exists.Notes
referenceType = user(like a normal user award) so the standard "you received an award" notification fires for the receiver.PR 2 of 3 for the giveback launch (next: leaderboard + causes breakdown). Depends on the merged milestones PR only for the shared worker topic.